# Contributor: Carlo Landmeter
# Maintainer:
pkgname=scstadmin
pkgver=2.2.0
pkgrel=2
pkgdesc="SCST administration tool written in perl"
url="http://scst.sourceforge.net"
arch="noarch"
license="GPL-2.0"
depends="perl"
makedepends="perl-dev"
install=
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/scst/$pkgname-$pkgver.tar.bz2
	scstadmin.initd
	"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
        cd "$_builddir"/scstadmin.sysfs/scst-0.9.10
        PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
	cd "$_builddir"
}

package() {
	cd "$_builddir"/scstadmin.sysfs/scst-0.9.10
	make DESTDIR="$pkgdir" install || return 1

        cd "$_builddir"
	mkdir -p "$pkgdir"/var/lib/scst/pr
	install -Dm755 scstadmin.sysfs/scstadmin "$pkgdir"/usr/sbin/scstadmin || return 1
	install -Dm755 "$srcdir"/scstadmin.initd "$pkgdir"/etc/init.d/scstadmin || return 1
}

sha512sums="0c1ebf27203c63f3ec16a6c4ca159d4203da902ed8cc3fc6b8a415847c39a83294609c325e0c736e60a8e7cbb445ab2f3914dd9df980238363c6d8be98f0d08e  scstadmin-2.2.0.tar.bz2
ba39bb8e7bfd77cfcdac42c8f34867d1dbccd0f153307e1630ecc0d11a02fb8275aecd87ea8a05c2d1fa939457e434a5a8c26c69f6f1cf9a47ef486eb0ab43a3  scstadmin.initd"
